package com.tang.model.vo;

import java.util.List;

/**
 * 规则树建造者
 * 
 * @author Tang
 */
public final class TreeNodeBuilder {
    private Long treeId;            //规则树ID
    private Long treeNodeId;        //规则树节点ID
    private Integer nodeType;       //节点类型；1子叶、2果实
    private String nodeValue = null;       //节点值[nodeType=2]；果实值
    private String ruleKey;         //规则Key
    private String ruleDesc;        //规则描述
    private List<TreeNodeLink> treeNodeLinkList; //节点链路

    private TreeNodeBuilder() {
    }

    public static TreeNodeBuilder builder() {
        return new TreeNodeBuilder();
    }

    public TreeNodeBuilder treeId(Long treeId) {
        this.treeId = treeId;
        return this;
    }

    public TreeNodeBuilder treeNodeId(Long treeNodeId) {
        this.treeNodeId = treeNodeId;
        return this;
    }

    public TreeNodeBuilder nodeType(Integer nodeType) {
        this.nodeType = nodeType;
        return this;
    }

    public TreeNodeBuilder nodeValue(String nodeValue) {
        this.nodeValue = nodeValue;
        return this;
    }

    public TreeNodeBuilder ruleKey(String ruleKey) {
        this.ruleKey = ruleKey;
        return this;
    }

    public TreeNodeBuilder ruleDesc(String ruleDesc) {
        this.ruleDesc = ruleDesc;
        return this;
    }

    public TreeNodeBuilder treeNodeLinkList(List<TreeNodeLink> treeNodeLinkList) {
        this.treeNodeLinkList = treeNodeLinkList;
        return this;
    }

    public TreeNode build() {
        TreeNode treeNode = new TreeNode();
        treeNode.setTreeId(treeId);
        treeNode.setTreeNodeId(treeNodeId);
        treeNode.setNodeType(nodeType);
        treeNode.setNodeValue(nodeValue);
        treeNode.setRuleKey(ruleKey);
        treeNode.setRuleDesc(ruleDesc);
        treeNode.setTreeNodeLinkList(treeNodeLinkList);
        return treeNode;
    }
}
